package com.massteam.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.massteam.dao.BaseDAO;
import com.massteam.pojo.Apk;
import com.massteam.service.ApkService;

/**
 * @author 作者liuchengwei E-mail:liuchengwei98@163.com
 * @version 0.1
 * @since 创建时间：2012-1-6 下午04:19:56
 */
@Repository
public class ApkServiceImpl implements ApkService{
	@Autowired
	@Qualifier("baseDao")
	BaseDAO baseDao;

	@Transactional(readOnly=false)
	public void addApk(Apk apk) {
		baseDao.saveOrUpdate(apk);
	}

	public void delApk(String id) {
		baseDao.delById(Apk.class, id);
	}

	@SuppressWarnings("unchecked")
	public List<Apk> queryApk(String hql) {
		return (List<Apk>) baseDao.query(hql);
	}

	public void updateApk(String hql) {
		baseDao.update(hql);
	}

	public Apk findApkById(String id) {
		return (Apk) baseDao.loadById(Apk.class, id);
	}

}
